<!--基础数据处理-->
function toyData(){
    let number=$("#number").val();
    let price=$("#price").val();
    let toyCount=$("#toyCount").val();
    let count=$("#count").val();
    let failure=$("#failure").val();
    let isscrap=$("#isscrap").val();
    let param = new URLSearchParams();
    param.append("number",number);
    param.append("price",price);
    param.append("toyCount",toyCount);
    param.append("count",count);
    param.append("failure",failure);
    param.append("isscrap",isscrap);
    axios.post("toyData",param)
        .then(function(){
            alert("toySave Success")
        })
}
function userData(){
    let userid=$("#userid").val();
    let name=$("#name").val();
    let address=$("#address").val();
    let phone=$("#phone").val();
    let points=$("#points").val();
    let cash=$("#cash").val();
    let param = new URLSearchParams();
    param.append("userid",userid);
    param.append("name",name);
    param.append("address",address);
    param.append("phone",phone);
    param.append("points",points);
    param.append("cash",cash);
    axios.post("userData",param)
        .then(function(){
            alert("userData Success")
        })
}
<!--营业数据处理 -->
<!--时间有点紧，先这样写， -->
function rentToy(){
    let toyId=$("#toyId").val();
    let userId=$("#userId").val();
    let param = new URLSearchParams();
    param.append("toyId",toyId);
    param.append("userId",userId);
    axios.post("rentToy",param)
        .then(function(){
            alert("rentToy Success")
        })
}
function returnToy(){
    let toyId=$("#toyId").val();
    let userId=$("#userId").val();
    let param = new URLSearchParams();
    param.append("toyId",toyId);
    param.append("userId",userId);
    axios.post("returnToy",param)
        .then(function(){
            alert("returnToy Success")
        })
}
/*----------------------按玩具号图形统计-------------------------*/
var myChart = echarts.init(document.getElementById('line1'));
setInterval(function () {
    $.ajax({
        contentType: "application/json",
        type: "POST",
        url: "queryToyCount",
        dataType: "json",
        success: function (data) {
            let x = [];
            let y = [];
            //根据玩具编号查得到玩具数量
            for (let i = 0; i < data.length; i++) {
                x[i] = data[i].id;
                y[i] = data[i].count;
            }
            myChart.setOption({
                title: {
                    text: '玩具数量',
                },
                tooltip: {},
                label: {
                    show: true,
                    position:'top',
                },
                legend: {},
                xAxis: {
                    data: x
                },
                yAxis: {},
                series: [
                    {
                        colorBy:'data',
                        name: '数量',
                        type: 'bar',
                        data: y

                    }
                ]
            });

        },
        error: function () {
        }
    })
},1000)
/*-----------------------------------------------*/
let myChart1 = echarts.init(document.getElementById('line2'));
setInterval(function () {
    $.ajax({
        contentType: "application/json",
        type: "POST",
        //url: "queryCount",
        url: "queryPoint",
        dataType: "json",
        success: function (data) {
            let x = [];
            let y = [];

            for (let i = 0; i < data.length; i++) {
                x[i] = data[i].name;
                y[i] = data[i].points;
            }
            myChart1.setOption({
                title: {
                    text: '会员积分',
                },
                tooltip: {},
                label: {
                    show: true,
                    position:'top',
                },
                legend: {},
                xAxis: {
                    data: x
                },
                yAxis: {},
                series: [
                    {
                        colorBy:'data',
                        name: '数量',
                        type: 'bar',
                        data: y

                    }
                ]
            });

        },
        error: function () {
        }
    })
}, 1000)